<%@page contentType="text/xml;charset=utf-8"%>
<%@ page import="java.util.*" %>
<%
	List li = new ArrayList();
	StringBuffer sb = new StringBuffer();
	sb.append("R||김을신|123456789|10.12345|2003/09/08|2003/09|1029|13:00:12|18:00|2013/10/29 09:32:15|2013/10/29 09:32");
  	
 	for(int i=0;i<10;i++){
		sb.append("@R||김을신|123456789|10.12345|2003/09/08|2003/09|1029|13:00:12|18:00|2013/10/29 09:32:15|2013/10/29 09:32");
		sb.append("@R||김을신|000000000|0.12345|2003/09/08|2003/09|1029|13:00:12|18:00|2013/10/29 09:32:15|2013/10/29 09:32");
		sb.append("@R|1|가나다|11111111|1111.11111|2003/09/08|2003/09|1029|13:00:12|18:00|2013/10/29 09:32:15|2013/10/29 09:32");
	} 

	String[] Savename = {"DDD","AAA","BBB","CCC","EEE","FFF","GGG","HHH","III","JJJ","KKK","LLL"};
	String[] rows = sb.toString().split("@");
	
	for (int i = 0; i < rows.length; i++) {
		String[] row = rows[i].split("\\|");
		Map mp = new HashMap();
		for (int c=0; c<Savename.length; c++) {
			if(c==3) {
				mp.put(Savename[c], Integer.parseInt(row[c]));
			}else if(c==4){
				mp.put(Savename[c], Float.parseFloat(row[c]));
			}else if(c==5||c==6||c==7||c==8||c==9||c==10||c==11){
				Date date = new Date();
				mp.put(Savename[c], date);
			} else {
				mp.put(Savename[c], row[c]);
			}
		}
		
		li.add(mp);
	}
	
	try {
		request.setAttribute("SHEETDATA", li);
		String forwardPath = "./direct_down_to_excel.jsp";
		if(!"".equals(forwardPath)){
			RequestDispatcher rd = request.getRequestDispatcher(forwardPath);
			rd.forward(request,response);
		}
	} catch(Exception ex) {
		ex.printStackTrace();		
	}


%>
